'use strict';

const crypto = require('crypto');
const MD5_KEY = 'adksjfhaklsdjfqiuyahsldjclkjasdhfuqwehflaksjdhfljab;alsdf[quwe90';

class YBTool {

  /**
   * MD5
   * @param {*} str 要加密的字符串
   */
  static MD5(str) {
    const data_str = str + MD5_KEY;
    const hash = crypto.createHash('md5');
    hash.update(data_str);
    return hash.digest('hex');
  }
}

module.exports = YBTool;
